﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace W5_DoAnCuoiKy_Glow.Content
{
    public partial class Master : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CurrentContext.IsLogged == true)
            {
                string maTK = CurrentContext.UserName;

                USER us = new USER(null, null, maTK);
                Session["TK"] = us.MaTK;
                Session["TenTK"] = us.GetTenTK();
                Session["AccessLogin"] = 1;
                Session["LoaiTK"] = us.GetLoaiTK();

                lbLoiChao.Text = "Xin chào " + us.GetTenTK();

                pnDaDangNhap.Visible = true;
                pnChuaDangNhap.Visible = false;
                
                

            }
            if (CurrentContext.IsLogged == false)
            {
                pnDaDangNhap.Visible = false;
                pnChuaDangNhap.Visible = true;
            }
        }
    }
}
